<?php
/**
 * This file is part of won-uploader.
 *
 * Author: Daniel K.
 *
 * won-uploader is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * won-uploader is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with won-uploader. If not, see <http://www.gnu.org/licenses/>.
 */
   
 if( !defined("won-uploader")) die();    // Silence is golden
 
 require_once $_paths->getIncludePath("Exceptions");

 class TemplateLoader
 {
 	public function __construct()
 	{
 		
 	}
 	
 	/**
 	 * Loads a template
 	 * @param string $what	Type ('main'/'admin')
 	 */
 	public function loadTemplate($what)
 	{
 		global $_paths;
 		global $_nano;
 		global $_document;
 		
 		$tpl = $_paths->getTemplate($what);
 		
 		if( ! file_exists($tpl))
 			throw new Exception("template not found",Exceptions::TEMPLATE_404);
 		
 		require_once $tpl; 
 	}
 }
?>